#用户模块的蓝图，包括用户模块的资源
from flask import Blueprint
from flask_restful import Api
from comment.utils.output import output_json
from comment.models.user import User
user_bp=Blueprint('users',__name__,url_prefix='/user')#创建资源
user_api = Api(user_bp) #创建蓝图中的资源api
#使用我们自定义的json格式，替代装饰器的写法
user_api.representation('application/json')(output_json)
#加载当前模块的资源
from Shopping.resources.user.user_resource import Shopping_User,User_Sms,AuthorizationCodeResource,RegisterUserResource,UserLoginResource,IsExistFormResource,UserLoginOutResource
user_api.add_resource(Shopping_User,'/hello',endpoint='user')
user_api.add_resource(User_Sms,'/sms',endpoint='sms')
user_api.add_resource(AuthorizationCodeResource,'/authorization',endpoint='autherization')
user_api.add_resource(RegisterUserResource,'/register',endpoint='register')
user_api.add_resource(UserLoginResource,'/login',endpoint='login')
user_api.add_resource(IsExistFormResource,'/isExist',endpoint='isExist')
user_api.add_resource(UserLoginOutResource,'/logout',endpoint='logout')
